package com.lqq.mapper;

import com.lqq.pojo.Employee;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface EmployeeMapper {
    @Select("select * from employee")
    List<Employee> selectAllEmployee();

    @Select("select * from employee where id=#{id}")
    Employee selectEmployee(int id);


    @Insert("insert into employee values(#{id},#{lastName},#{email},#{gender},#{did})")
    int addEmployee(Employee employee);

    @Update("update employee set lastName=#{lastName},email=#{email},gender=#{gender},did=#{did} where id=#{id}")
    int updateEmployee(Employee employee);

    @Delete("delete from employee where id=#{id}")
    int deleteEmployee(int id);
}
